package ${packageName}.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;

/**
 * @description [<#if tableComment??>${tableComment}模型</#if>]
 * @author ${author}
 * @date ${date}
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("${tableName}")
public class ${className} implements Serializable {
    <#if tableColumnList?exists>
    <#assign number = 0>
    <#list tableColumnList as koiColumn>

    /** ${koiColumn.columnComment!} */
    <#if (koiColumn.isPk == '0' && number == 0)>
    <#assign number = number + 1>
    @TableId(value = "${koiColumn.columnName}", type = IdType.ASSIGN_ID)
    private ${koiColumn.javaType} ${koiColumn.javaField};
    <#elseif koiColumn.javaField == 'createTime'>
    @TableField(value = "${koiColumn.columnName}", fill = FieldFill.INSERT)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private ${koiColumn.javaType} ${koiColumn.javaField};
    <#elseif koiColumn.javaField == 'updateTime'>
    @TableField(value = "${koiColumn.columnName}", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private ${koiColumn.javaType} ${koiColumn.javaField};
    <#else>
    @TableField(value = "${koiColumn.columnName}")
    private ${koiColumn.javaType} ${koiColumn.javaField};
    </#if>
    </#list>
    </#if>

}
